home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 3 / Your Choice Software Collection 3.iso / docs / alias / long.al next >
Text File  |  1994-09-08  |  36KB  |  1,181 lines

  1. #: 288513 S10/JP Software
  2. !   26-Jul-94  21:14:31
  3. Sb: #My favorite aliases
  4. Fm: Sean Fosmire 76207,1120
  5. To: All
  6.  
  7. These are my favorite aliases.
  8.  
  9. I would like to propose that this thread continue with contributions from
  10. anyone who is interested.  Perhaps someone could eventually collect the
  11. messages and the aliases listed into one file for upload.
  12.  
  13. Some of my most useful aliases:
  14.  
  15.  
  16. ca copy %1 %2 %3 %4 %5 %6 %7 %8 %9 a:\
  17. :   allows for entry of several filespecs for quick copy to A
  18. sc select /od copy (%2*.*) %1
  19. :   organizes list of files then allows selection for copying
  20. :   1st RP is the destination directory
  21. sca select /o-d copy (%1*.*) a:\
  22. :   combines the best of the two above
  23. :   presents the current files, in reverse chronological order
  24. :   to permit selection for copying to A
  25. :   this way, the most recently added or changed files are on top
  26. :   I also have "sm" and "sma" which do the same thing for the move command
  27. :
  28. :-------------------------------------------------------------
  29. :   NOTE on replaceable parameters in aliases
  30. :   I frequently use the last RP in an alias as the first character
  31. :    in a wildcard
  32. :   see examples above and one below
  33. :   this allows for quick narrowing by filename by entering one or more letters
  34. :   e.g., with "d" below, enter "d ca" to list all files beginning with "ca"
  35. :-------------------------------------------------------------
  36. :
  37. d dir/jp %1*.*
  38. :   the "jp" is my preference -- separate extensions, stop display by page
  39. :
  40. fre free c: d: e: f: g: j: n: > c:\freedoc ^ type c:\freedoc
  41. :   uses the "free" command to display free space on all current drives
  42.  
  43. I would invite other submissions.
  44.  
  45.   Sean
  46.  
  47. There are 2 Replies.
  48.  
  49. #: 288580 S10/JP Software
  50. )   27-Jul-94  13:19:43
  51. Sb: #288513-My favorite aliases
  52. Fm: Michael Geary 76146,42
  53. To: Sean Fosmire 76207,1120
  54.  
  55. Sean, good idea on the "favorite alias" thread.  Here are some of my
  56. favorites to go along with yours...
  57.  
  58. First a few shortcuts to help manage aliases themselves:
  59.  
  60. : Make it easier to type the ALIAS command
  61. al*ias  *alias
  62.  
  63. : Edit Aliases
  64. ea      edit c:\txt\alias.lst
  65.  
  66. : Load Aliases
  67. la      ua * ^ alias /r c:\txt\alias.lst && echo Aliases loaded
  68.  
  69. : Clear Aliases
  70. ua      unalias
  71.  
  72. Then, the alias I use more often than any other:
  73.  
  74. : List the output of a command
  75. l*cmd   (%&) | list /s
  76.  
  77. This just runs any command and pipes its output to the LIST command.  Very
  78. simple, but extremely useful.  L MEM /C is a typical use, or even L DIR.
  79.  
  80. When I saw your FRE alias, I realized there was one thing missing from LCMD:
  81. it threw away the command output after piping it into LIST.  I changed it to
  82. save the file like your alias does, so now it's:
  83.  
  84. l*cmd   (%&) >C:\TEMP\LCMD%_shell.LST ^ list C:\TEMP\LCMD%_shell.LST
  85.  
  86. In case I run LCMD in more than one DOS session under Windows, the %_shell
  87. gives a unique file name to each of the "pipe" files.  You could use %@unique
  88. for this, but I wanted to be able to pick my own file name.
  89.  
  90. My FRE alias is identical to yours except it doesn't have the redirection
  91. (and the number of drive letters).  With the LCMD alias, you could cut FRE
  92. down to:
  93.  
  94. fre     free c: d: e: f: g: j: n:
  95.  
  96. and type L FRE at the C> prompt.  (Or, of course, include the L at the
  97. beginning of the FRE alias itself if you always run it that way.)
  98.  
  99. One last one for now is many people's favorite:
  100.  
  101. : Run a program in a specified directory: IN <path> <program>
  102. in      pushd %1 ^ %2& ^ popd
  103.  
  104. This replaces all the batch files that wrap PUSHD and POPD around some
  105. program that likes to be run from its own directory.
  106.  
  107. My last one for now is a variation on this theme.  I normally run my DOS
  108. sessions in 50 line mode.  A fair number of DOS programs have to run in 25
  109. line mode.  Most of those are smart enough to at least switch to thame mode
  110. first, but some are not.  They leave my screen in 50 line mode and run in the
  111. top half of the screen, leaving the bottom half with whatever was on it.
  112.  
  113. Anyone who uses 50 line mode has run into this and may have batch files that
  114. call MODE 80,25 before running such programs and MODE 80,50 after.  The easy
  115. way is:
  116.  
  117. in25    mode 80,25 ^ %& ^ mode 80,50
  118.  
  119. (Actually, I use my own 25 and 50 programs to switch screen height--they're
  120. basically the same as MODE 80,XX but they also set the screen colors I like.
  121. The concept of the alias is the same regardless.)
  122.  
  123. IN25 and IN combine well.  To run V Communications' System Commander, I use:
  124.  
  125. scin    in25 in c:\sc *scin
  126.  
  127.  
  128. This is equivalent to the batch file:
  129.  
  130. mode 80,25
  131. pushd c:\sc
  132. scin
  133. popd
  134. mode 80,50
  135.  
  136. One last tip.  Try changing your CA alias to this:
  137.  
  138. ca      copy %& a:\
  139.  
  140. The %& is the same as your %1 %2 . . . %9 but handier, and it removes the
  141. limit of nine parameters.
  142.  
  143. That's all for now...
  144.  
  145. -Mike
  146.  
  147. p.s.  I don't get credit for most of these aliases, I'm just passing them
  148. along.  Various 4DOS users here in the forum and elsewhere have come up with
  149. these tricks.
  150.  
  151. #: 288861 S10/JP Software
  152. !   29-Jul-94  23:05:27
  153. Sb: #288580-#My favorite aliases
  154. Fm: Sean Fosmire 76207,1120
  155. To: Michael Geary 76146,42 (X)
  156.  
  157. Mike -
  158.  
  159. Thanks for the tips.  I like the technique of piping output directly to the
  160. List command.  Can be very handy for some applications.  The benefit of
  161. directing output to a file is that it remains available for later reference,
  162. until the next time the alias is run.
  163.  
  164. And thanks for your advice on %& as an RP.  I was not aware of that one.
  165.  
  166. Your comment on attribution of aliases is a good one.  I suspect that the CA
  167. alias I posted came from someone else.  Certainly, about half of the aliases in
  168. my ALIASES file came from someone else's imagination, so if any of us post one
  169. which someone else has originated, I hope we all consider it in the spirit of a
  170. general advancement of alias technique.
  171.  
  172. One alias I neglected to add to my previous posting, and one which I use quite
  173. often, is deceptively simple:
  174.  
  175. ix dir/djs > index
  176. :  This produces an ASCII file listing all files in the current directory
  177. :  and all subdirectories.  If run from C:\, it will list all files in all
  178. :  directories, with summary information.
  179.  
  180. I find myself using the INDEX quite often, using the List command or my Select
  181. List alias, which is:
  182.  
  183. sl select list (%1*.*)
  184.  
  185. I'm finding a lot of good ideas in these replies.
  186.  
  187.   Sean
  188.  
  189. There are 3 Replies.
  190.  
  191. #: 288900 S10/JP Software
  192. !   30-Jul-94  15:31:17
  193. Sb: #288861-#My favorite aliases
  194. Fm: Howard Goldstein 71435,1203
  195. To: Sean Fosmire 76207,1120
  196.  
  197. Here's my favorite alias.  It's a bit more complex than some of the others
  198. that have been contributed here but I hope someone reading this will find it
  199. useful.
  200.  
  201. This is an alias for the TIME command.  If entered with no operands, the date
  202. and time are displayed as with the normal TIME command but the user is not
  203. prompted for a new time.  If a parameter is given, the time is set.
  204.  
  205. Note that this should all be entered on one line and that the caret (^) is
  206. used as the command separator:
  207.  
  208. time iff %#==0 then^keystack enter^*time|echo %@line[con,0]^
  209.      else^*time %&^endiff
  210.  
  211.  
  212.  
  213. There is 1 Reply.
  214.  
  215. #: 288933 S10/JP Software
  216. !   31-Jul-94  01:07:46
  217. Sb: #288900-#My favorite aliases
  218. Fm: Mike Bessy [Forum Admin] 75300,1215
  219. To: Howard Goldstein 71435,1203 (X)
  220.  
  221. Howard,
  222.  
  223. May I suggest a variation that doe _not_ require that KSTACK be loaded and can
  224. also be used under OS/2 or NT (with suitable ParameterChar and CommandSep, of
  225. course):
  226.  
  227.    time=iff "%&"=="" then^echo The time is %_time^else^echo %&|*time^endiff
  228.  
  229.  07-30-94  23:30 CDT
  230.  
  231. There is 1 Reply.
  232.  
  233. #: 288946 S10/JP Software
  234. !   31-Jul-94  11:52:33
  235. Sb: #288933-#My favorite aliases
  236. Fm: Howard Goldstein 71435,1203
  237. To: Mike Bessy [Forum Admin] 75300,1215 (X)
  238.  
  239. Thanks, Mike.
  240.  
  241. A question though:  In the "else" part of your alias you have
  242.    echo %&|*time
  243. Why not the much simpler
  244.  
  245.    *time %&
  246.  
  247. Howard
  248.  
  249.  
  250. There is 1 Reply.
  251.  
  252. #: 288955 S10/JP Software
  253. !   31-Jul-94  15:38:50
  254. Sb: #288946-My favorite aliases
  255. Fm: Mike Bessy [Forum Admin] 75300,1215
  256. To: Howard Goldstein 71435,1203 (X)
  257.  
  258. Howard,
  259.  
  260. Indeed, "*time %&" should be more than sufficient.
  261.  
  262.  07-31-94  14:20 CDT
  263.  
  264. #: 291016 S10/JP Software
  265. !   23-Aug-94  07:01:25
  266. Sb: #288955-#My favorite aliases
  267. Fm: Don E. Groves, Jr. 71310,3702
  268. To: Mike Bessy [Forum Admin] 75300,1215 (X)
  269.  
  270. This seems the perfect place to add my DATER and DATER12 aliases to the list:
  271.  
  272. DATER=(dater_date %+ ECHO  %_time)
  273.  
  274. DATER12=(dater_date %+ dater_time ^echo.)
  275.  
  276. DATER_DATE=
  277.   ECHOS %_Dow %@substr[JanFebMarAprMayJunJulAugSepOctNovDec,
  278.         %@eval[(%@substr[%_date,0,2]-1)*3],3] %@eval[%@substr[%_date,3,2]],
  279.         19%@substr[%_date,6,2]
  280.  
  281. DATER_TIME=
  282.    ECHOS  %@substr[12 1 2 3 4 5 6 7 8 91011,
  283.           %@eval[%@substr[%_time,0,2] %% 12*2],2]
  284.           %@substr[%_time,2,6]
  285.           %@substr[AP,%@int[%@eval[%@time[%_time]/3600/12]],1]M
  286.  
  287.  
  288. (note DATER_DATE and DATER_TIME each go on one long line a piece. :-)
  289.  
  290. They produce the output in the format of:
  291.   DATER
  292.   Tue Aug 23, 1994 00:23:16
  293.  
  294. and
  295.   DATER12
  296.   Tue Aug 23, 1994 12:24:03 AM
  297.  
  298. And yes the are all pipeable to a file or whereever.
  299.  
  300. DG.. {back again <G>}
  301.  
  302. There is 1 Reply.
  303.  
  304. #: 291221 S10/JP Software
  305. !   24-Aug-94  19:05:58
  306. Sb: #291016-My favorite aliases
  307. Fm: Howard Goldstein 71435,1203
  308. To: Don E. Groves, Jr. 71310,3702
  309.  
  310. Don,
  311.  
  312. Interesting aliases!  I'd like to point out though that DATER_DATE and
  313. DATER_TIME could be greatly simplified by using the _MONTH, _DAY, etc. system
  314. variables available in 4DOS 5 rather than extracting the various fields from
  315. _DATE and _TIME.  For example:
  316.  
  317. DATER_DATE=
  318.   ECHOS %_Dow %@substr[JanFebMarAprMayJunJulAugSepOctNovDec,
  319.         %@eval[(%_month-1)*3],3] %_day, %_year
  320.  
  321.                                        Howard
  322.  
  323.  
  324. #: 289169 S10/JP Software
  325. !   02-Aug-94  12:42:55
  326. Sb: #288861-My favorite aliases
  327. Fm: Charlie Weesner 71310,347
  328. To: Sean Fosmire 76207,1120
  329.  
  330. Sean,
  331.  
  332. My "favorite" three aliases require using NCD (Norton's Change Directory) or
  333. LCD (LED's Change Directory).  These programs provide direct navigation from
  334. any level of the directory tree to any other level (including completion of
  335. partial directory names or mis-spellings).
  336.  
  337. cd=lcd
  338. md=lcd md
  339. rd=lcd rd
  340.  
  341. If you want to use the original command, rather than the alias, you either
  342. "chdir" or "*cd" where the "*" disables any alias replacement of the
  343. command.
  344.  
  345. Charlie
  346.  
  347.  
  348. #: 289192 S10/JP Software
  349. !   02-Aug-94  14:53:39
  350. Sb: #288861-My favorite aliases
  351. Fm: Michael Geary 76146,42
  352. To: Sean Fosmire 76207,1120
  353.  
  354. Yes, I wouldn't worry too much about attributing aliases to the right person.
  355. A lot of them have been floating around so long that no one remembers who
  356. first thought of them. <g>
  357.  
  358. -MG
  359.  
  360. #: 289100 S10/JP Software
  361. !   02-Aug-94  00:00:58
  362. Sb: #288580-#My favorite aliases
  363. Fm: Niels Schaumann 73763,352
  364. To: Michael Geary 76146,42 (X)
  365.  
  366. Michael,
  367.  
  368.  > : List the output of a command l*cmd   (%&) | list /s
  369.  
  370. I like this one!  Very nice ....
  371.  
  372. Here's one (a pair, actually) of my favorites:
  373.  
  374. :walks back up the directory tree from current location, # levels = # dots
  375. .*........  pushd%0
  376.  
  377. :nothing fancy, just what it says
  378.              popd
  379.  
  380. I've gotten used to these, been using them for a couple of years.  I don't
  381. remember who came up with them .... I do remember someone pointing out that
  382. the "multiple dots" weren't supposed to work, but hey ..... they sure do!
  383.  
  384.  
  385.                                               --Niels
  386.  
  387.  
  388. There is 1 Reply.
  389.  
  390. #: 289193 S10/JP Software
  391. !   02-Aug-94  14:53:42
  392. Sb: #289100-#My favorite aliases
  393. Fm: Michael Geary 76146,42
  394. To: Niels Schaumann 73763,352 (X)
  395.  
  396. Neat!  I didn't know you could use just "." (or "....", etc.) as a command
  397. name.  Since you can also use "..\" (with any number of dots) as a shortcut
  398. for CD, this lets you do either the CD or the PUSHD very easily.
  399.  
  400. There is 1 Reply.
  401.  
  402. #: 288623 S10/JP Software
  403. !   27-Jul-94  20:11:56
  404. Sb: #288513-My favorite aliases
  405. Fm: Gary M. Berg 70106,1624
  406. To: Sean Fosmire 76207,1120
  407.  
  408. Let's see, what do I have sitting around in my 4DOS.ALI file:
  409.  
  410.  ;    Clear the screen
  411.  clear           cls white on blue
  412.  
  413.  ;    Run a command and pipe stdout into LIST
  414.  so              %& | list/s
  415.  
  416.  ;    Use a "string" utility to get likely "text" in a file, send it to
  417.  ;    stdout and view it with LIST
  418.  inside          so string %&
  419.  
  420.  ;    Reload standard aliases
  421.  new_4d*os       unalias * ^ alias /r c:\cmd\4dos.ali
  422.  
  423.  ;    Control/T runs MAPMEM
  424.  @@ctrl-T        mapmem
  425.  
  426.  ;    Alt-F4 types EXIT - similar to closing a winapp
  427.  @@Alt-F4        exit
  428.  
  429.  ;
  430.  ;    Directory management utilities.  Allow changing to a subdir to run
  431.  ;    a program and then return - will not have changed current directory
  432.  ;    on any drives.
  433.  popdir_2
  434.  popdir_3
  435.  push_xd         pushd d: ^ pushd
  436.  push_xdf        pushd d: ^ pushd e: ^ pushd
  437.  push_xe         pushd e: ^ pushd
  438.  ;   Example of using push and pop routines
  439.  alpha*4         push_xde^cd \alpha4^*a4 %&^popdir_3
  440.  
  441.  ;
  442.  ;   ACD is a utility a bit like NCD; use it so an invalid command tries
  443.  ;   to change to the command line as a sub-directory.
  444.  UNKNOWN_CMD     acd %1
  445.  
  446. #: 288751 S10/JP Software
  447. !   28-Jul-94  21:49:15
  448. Sb: #288623-#My favorite aliases
  449. Fm: Gary M. Berg 70106,1624
  450. To: Gary M. Berg 70106,1624 (X)
  451.  
  452. <red faced>
  453.  
  454.  popdir_2           popd^popd
  455.  popdir_3           popd^popd^popd
  456.  
  457. Probably obvious, but...
  458.  
  459. There is 1 Reply.
  460.  
  461. #: 288759 S10/JP Software
  462. !   29-Jul-94  00:38:53
  463. Sb: #288751-#My favorite aliases
  464. Fm: Kenneth Albanowski 70705,126
  465. To: Gary M. Berg 70106,1624 (X)
  466.  
  467. Gary,
  468.  
  469. >> <red faced> <<
  470.  
  471. Don't worry, those are perfectly decent aliases. FORTH has had "dup2" and
  472. "drop2" for quite some time, and they are just "dup dup" and "drop drop".
  473.  
  474. - Ken
  475.  
  476.  
  477.  
  478. There are 2 Replies.
  479.  
  480. #: 288795 S10/JP Software
  481. !   29-Jul-94  11:15:35
  482. Sb: #288759-#My favorite aliases
  483. Fm: Bryan S. (TurboPower) 71175,3534
  484. To: Kenneth Albanowski 70705,126 (X)
  485.  
  486.  >> "dup dup" and "drop drop" <<
  487.  
  488. As opposed to, say, "plop plop" and "fizz fizz"? <g>
  489.  
  490. --Bryan 
  491.  
  492. There is 1 Reply.
  493.  
  494. #: 288828 S10/JP Software
  495. !   29-Jul-94  17:12:03
  496. Sb: #288795-My favorite aliases
  497. Fm: Kenneth Albanowski 70705,126
  498. To: Bryan S. (TurboPower) 71175,3534 (X)
  499.  
  500. Bryan,
  501.  
  502. And of course the ever popular "bork3". (Coooome heeeere leettle chicky!)
  503.  
  504. - Ken
  505.  
  506.  
  507.  
  508. #: 288849 S10/JP Software
  509. !   29-Jul-94  21:16:53
  510. Sb: #288759-My favorite aliases
  511. Fm: Gary M. Berg 70106,1624
  512. To: Kenneth Albanowski 70705,126
  513.  
  514. Ken,
  515.  
  516. Oh, you misunderstood, I left the definition of those two aliases out of the
  517. message I was commenting to.  The red face was from not proofing my message
  518. before I sent it.  The popdir_2 and such go with somewhat more useful macros
  519. which save the current directory on this and 1 or 2 other drives.
  520.  
  521. #: 288923 S10/JP Software
  522. !   30-Jul-94  22:32:19
  523. Sb: #288849-#My favorite aliases
  524. Fm: Kenneth Albanowski 70705,126
  525. To: Gary M. Berg 70106,1624 (X)
  526.  
  527. Gary,
  528.  
  529. Indeed I did misunderstand, my fault completly. (Besides, if I'm going to
  530. comment on "simple alises", I should add it my "lsit=list" <g>)
  531.  
  532. - Ken
  533.  
  534.  
  535. There is 1 Reply.
  536.  
  537. #: 289006 S10/JP Software
  538. !   01-Aug-94  09:47:35
  539. Sb: #288923-#My favorite aliases
  540. Fm: Bryan S. (TurboPower) 71175,3534
  541. To: Kenneth Albanowski 70705,126 (X)
  542.  
  543.  >> "lsit=list" <<
  544.  
  545. You do that too? <g>  I have a "compile" alias which is also aliased as
  546. "xinoukw"!!! <g>
  547.  
  548. --Bryan 
  549.  
  550. There is 1 Reply.
  551.  
  552. #: 288840 S10/JP Software
  553. !   29-Jul-94  17:56:57
  554. Sb: #288623-#My favorite aliases
  555. Fm: Dave Hill 71020,2604
  556. To: Gary M. Berg 70106,1624 (X)
  557.  
  558. I had a "MO" alias similar to your "so", and in order to handle some unusual
  559. command lines and make it more universal, I changed it to:
  560.   MO=(%&) | LIST /S
  561.  
  562. This should work everywhere the other one does, and handles a multi-command
  563. line.
  564.                         Regards,
  565.                            Dave
  566.  
  567. There is 1 Reply.
  568.  
  569. #: 288850 S10/JP Software
  570. !   29-Jul-94  21:17:01
  571. Sb: #288840-My favorite aliases
  572. Fm: Gary M. Berg 70106,1624
  573. To: Dave Hill 71020,2604
  574.  
  575. Dave,
  576.  
  577. I guess I've never tried to pass a multi-command line to my SO alias.  "SO"
  578. would work if all you were doing was piping from program to program; I never
  579. thought about doing several commands and dumping them all into LIST at the
  580. same time.
  581.  
  582. Wait a minute, I just tried you "SO" alias with:
  583.  
  584.    SO (dir^dir)
  585.  
  586. And I only got the output from the first DIR command; the second dir command
  587. came out after I exited LIST.
  588.  
  589. These are the aliases I was working with:
  590.  
  591.  so     (%&) | list/s
  592.  soe    (%&)>piped.xxx^attrib +r piped.xxx/q^me piped.xxx^del piped.xxx/q/z
  593.  
  594. Shouldn't that have worked?
  595.  
  596. #: 288901 S10/JP Software
  597. !   30-Jul-94  15:31:20
  598. Sb: #288850-#My favorite aliases
  599. Fm: Howard Goldstein 71435,1203
  600. To: Gary M. Berg 70106,1624 (X)
  601.  
  602. Gary,
  603.  
  604. The SO alias does work for multiple commands.  The reason it didn't work for
  605. you was that you weren't using it right.  Try `DIR^DIR` instead of (DIR^DIR).
  606.  
  607. Howard
  608.  
  609.  
  610.  
  611. There is 1 Reply.
  612.  
  613. #: 288908 S10/JP Software
  614. !   30-Jul-94  18:01:35
  615. Sb: #288901-#My favorite aliases
  616. Fm: Gary M. Berg 70106,1624
  617. To: Howard Goldstein 71435,1203 (X)
  618.  
  619.  >> Try `DIR^DIR` instead of (DIR^DIR).
  620.  
  621. I tried it both ways.  In both cases, the second "DIR" comes out after I have
  622. viewed the results for the first one with LIST.COM.  My alias is set up as:
  623.  
  624.   so  (%&) | list/s
  625.  
  626. So when I type:   so dir^dir
  627.  
  628. I get the second directory after the LIST viewer.  Have you _confirmed_ that
  629. it works with 4DOS 5.0F?
  630.  
  631. There are 2 Replies.
  632.  
  633. #: 288915 S10/JP Software
  634. !   30-Jul-94  21:55:44
  635. Sb: #288908-#My favorite aliases
  636. Fm: Jim Kyle (CLMFOR) 76703,762
  637. To: Gary M. Berg 70106,1624 (X)
  638.  
  639. Gary,
  640.   Typing so dir^dir is exactly the same as typing so dir on one line and then
  641. dir on the next line. However if you type it, at the prompt, as so `dir^dir`
  642. then you will in fact get two sequential directories passed into list. I just
  643. confirmed this using version 5.0F.
  644.   Your parentheses inside the alias can't do anything until the parser passes
  645. the command line in, and unless you shield the compound command from the
  646. parser with the reverse single quotes, the damage will already have been done
  647. by that time!
  648.   In fact, I believe (though Mike, Rex, or Tom may correct me on this) that
  649. your parentheses inside the alias do nothing at all. While using them is a
  650. good idea in defining C macros, to prevent precedence problems if you pass in
  651. an expression, the situation is drastically different in 4DOS. The parser has
  652. already been over the command line and done its thing, so any precedence
  653. problem that might exist (such as the command separator breaking off the back
  654. half of what you meant to pass to the alias) has already done its thing before
  655. ever reaching the parens...
  656.   When dealing with the 4DOS parser, the _only_ surefire protection method
  657. I've ever found is to bracket things inside of reversed quotes. In some cases,
  658. the square brackets work, but in others they don't. The reversed quotes always
  659. shield whatever they contain from the parser's view.
  660.  
  661.  
  662. There is 1 Reply.
  663.  
  664. #: 288947 S10/JP Software
  665. !   31-Jul-94  11:52:37
  666. Sb: #288915-My favorite aliases
  667. Fm: Howard Goldstein 71435,1203
  668. To: Jim Kyle (CLMFOR) 76703,762 (X)
  669.  
  670. Jim,
  671.  
  672. I believe that the parentheses within the SO alias are necessary.  The
  673. parentheses signify a "command group" to which we want the pipe to apply.
  674. Without them, the pipe would only apply to the last command in a multiple
  675. command line passed to the alias.
  676.  
  677. Howard
  678.  
  679.  
  680.  
  681. #: 288917 S10/JP Software
  682. !   30-Jul-94  22:06:43
  683. Sb: #288908-#My favorite aliases
  684. Fm: Howard Goldstein 71435,1203
  685. To: Gary M. Berg 70106,1624 (X)
  686.  
  687. Gary,
  688.  
  689. My SO alias is set up exactly the same as yours and SO `DIR^DIR` definitely
  690. works for me in 4DOS 5.0f.  Perhaps I wasn't clear enough in my last message.
  691. You need to put back quotes around the DIR^DIR so that that entire string will
  692. be treated as a single argument to SO.  Without the back quotes, only the
  693. first DIR is being passed to SO.
  694.  
  695. Howard
  696.  
  697.  
  698.  
  699. There are 2 Replies.
  700.  
  701. #: 288938 S10/JP Software
  702. !   31-Jul-94  10:02:16
  703. Sb: #288917-My favorite aliases
  704. Fm: Gary M. Berg 70106,1624
  705. To: Howard Goldstein 71435,1203 (X)
  706.  
  707. Mea Culpa!  I didn't notice the back-quotes!  Or thought they were a type.  In
  708. fact, this morning as I was laying in bed I started think what Jim Kyle said;
  709. that I have to do something to make the command separator on the original
  710. command line not be a command separator or I'd be doing "SO DIR" and "DIR".
  711.  
  712. So now, "SO" works fine.  I'd just never run into this problem of trying to
  713. pass multiple commands to an alias.
  714.  
  715. And checking shows me that the "()"'s are required, or else the first command
  716. is not sent into LIST.
  717.  
  718. #: 288896 S10/JP Software
  719. !   30-Jul-94  13:59:51
  720. Sb: #288513-My favorite aliases
  721. Fm: Eric Veldhuyzen 100010,3051
  722. To: Sean Fosmire 76207,1120
  723.  
  724. Sean,
  725.  
  726. You want some nice aliases? How about my dir alias under 4OS2:
  727.  
  728. DIR=iff "%1" eq "" then
  729.    ^set pad=.
  730.    ^else set pad=%1
  731.    ^endiff
  732.    ^iff exist %pad\descript.ion then
  733.    ^*dir /A/Z/P/O:gE/J %&
  734.    ^unset pad
  735.    ^quit
  736.    ^else
  737.    ^*dir /T/A/P/O:gE/J %&
  738.    ^unset pad
  739.    ^quit
  740.    ^endiff
  741.  
  742. This of course all on one line, but I cut it for readability.
  743.  
  744.  
  745. Eric Veldhuyzen in Oegstgeest, NL              30-Jul-94 at 19:45:13 MET
  746.  
  747. #: 289097 S10/JP Software
  748. !   01-Aug-94  23:20:53
  749. Sb: #288513-#My favorite aliases
  750. Fm: Ray Tackett 76416,276
  751. To: Sean Fosmire 76207,1120
  752.  
  753. Sean,
  754.  
  755. For sheer, compact elegance and usefulness, my favorite is one of Tom
  756. Rawson's:
  757.  
  758.   IN=pushd %1 ^ %2& ^ popd
  759.  
  760. Example:  in games mahjongg -b37
  761.  
  762. With the CDPATH environment variable set to C:\;D:\;etc., I don't need a
  763. ridiculous PATH to get to the hundreds of programs on my system.  It's also
  764. the basis for many of my other aliases and batch files.  For example:
  765.  
  766. TRACON=in tracon2 *tracon
  767.  
  768. allows me to run Wesson International's air traffic control simulation with a
  769. single command word no matter what the current directory and despite the fact
  770. that K:\TRACON2 is not on PATH and despite the fact that I can't remember
  771. what's on which logical drive.
  772.  
  773. Ray
  774.  
  775. There is 1 Reply.
  776.  
  777. #: 289741 S10/JP Software
  778. !   09-Aug-94  02:38:00
  779. Sb: #289097-#My favorite aliases
  780. Fm: Anthony Williams 76655,1552
  781. To: Ray Tackett 76416,276 (X)
  782.  
  783. Ray,
  784.  
  785. Do you have a good way to deal with directories that different drives,
  786. depending on whether a CDRom or Bernoulli or Ramdisk is installed?  I am faced
  787. with a situation where sometimes its E:\OZCIS, and sometimes F:\OZCIS. What's
  788. the slick way to handle this?
  789.  
  790. I have never paid attention to the CDPATH envar in 4Dos because I am happy
  791. with LCD.  Your example however shows how it can be used for commands other
  792. than CD.  But I wonder, if one puts most complicated commands into aliases,
  793. why not just enter the path there and be done with it?  Given aliases, does
  794. that method add anything?
  795.  
  796. I always look forward to your messages here for I have learned a lot from them
  797. over time.
  798.  
  799. Tony
  800.  
  801. There is 1 Reply.
  802.  
  803. #: 289750 S10/JP Software
  804. !   09-Aug-94  07:10:43
  805. Sb: #289741-#My favorite aliases
  806. Fm: Ray Tackett 76416,276
  807. To: Anthony Williams 76655,1552 (X)
  808.  
  809. Tony,
  810.  
  811. I don't have a good way to deal with the same directory on different drives. I
  812. usually try to keep names unique.  For example, my "day job" involves doing
  813. tech support for a COBOL compiler and a 370 Assembler emulator.  Each product
  814. has several versions which must be supported, so I have directories like
  815. COB3060, COB3159, COB3220, etc.
  816.  
  817. >>> Why not just enter the path ...
  818.  
  819. There's a long evolutionary history at this end.  It started with an XT clone
  820. and a 10 meg MFM drive which was all C:.  As CPUs and disks came, went, and
  821. grew, I kept adding drive letters.  The worst time was the combination of DOS
  822. 3.3 and 250 meg of disk.  Since no partition could be bigger than 32M, I ended
  823. up with a lot of drive letters.
  824.  
  825. Now I'm up to 1.5 gig with about 160 root-level directories.  Each logical
  826. drive (except C, which is just big enough to hold DOS) is >32M, but many a
  827. program hard-codes itself for a certain drive and directory at installation
  828. time.  As free space goes away and new software comes in, I move directory
  829. trees from one drive to another.  I don't want to remember what's where and I
  830. _certainly_ don't want to find and fix a bunch of hard-coded batch files and
  831. aliases every time I change something.  Try moving a Windows product such as
  832. W4W or Excel; find and fix all the .INI files, etc.  As Tropicana once put it,
  833. "It's more excitement than decent people need." <g>
  834.  
  835. Yeah, I'd probably spend a weekend merging logical drives, backing up,
  836. repartitioning, etc., but there are other payoffs.  One of my most-used
  837. packages has the habit of losing disk clusters.  That package resides in a
  838. special 18 meg logical drive (N:) where its bad habit won't affect anything
  839. else.  Such things provide convenient rationales for procrastination <g>.
  840.  
  841. It really comes down to personal style and its evolution over time.  "Your
  842. actual mileage may vary."
  843.  
  844. Ray
  845.  
  846. There is 1 Reply.
  847.  
  848. #: 289764 S10/JP Software
  849. !   09-Aug-94  11:16:25
  850. Sb: #289750-#My favorite aliases
  851. Fm: Anthony Williams 76655,1552
  852. To: Ray Tackett 76416,276 (X)
  853.  
  854. Ray,
  855.  
  856.  >> I don't have a good way to deal with the same directory on different
  857.  >> drives.
  858.  
  859. I didn't explain very well.  I avoid identically named directories (I know
  860. better).  The problem is that depending on my boot configuration, a program
  861. may be, for example, in E:\QPRO today and F:\QPRO tomorrow.  This can be
  862. caused by the presence or absence of a removable drive (Bernoulli) or a CDRom
  863. drive.
  864.  
  865. The question is somewhat moot, because at present I don't have this problem,
  866. but I recently did while trouble-shooting, and had cause to wonder whether
  867. there was a way around.  I thought I dimly remembered seeing something from
  868. you or Mike Bessy a couple of years ago showing how all drive letters could be
  869. replaced by envirs.  Given that I thought one could somehow detect the
  870. presence of one of the problem causer drives and change the envir accordingly.
  871. This came up when trying to make a Bernoulli IDE drive work on both Dos and
  872. OS/2 boots with Boot Manager.  Apparently it can't be done, short of very
  873. extreme measures, but in trying I had the problem described.
  874.  
  875. I too have lots of partitions and would like to find a better system to keep
  876. track of them.
  877.  
  878.  >> As free space goes away and new software comes in, I move directory
  879.  >> trees from one drive to another.
  880.  
  881. What is the *safest* way to do this?
  882.  
  883. Tony
  884.  
  885. There is 1 Reply.
  886.  
  887. #: 289811 S10/JP Software
  888. !   09-Aug-94  18:42:27
  889. Sb: #289764-#My favorite aliases
  890. Fm: Ray Tackett 76416,276
  891. To: Anthony Williams 76655,1552 (X)
  892.  
  893. Tony,
  894.  
  895. >>> E:\QPRO today and F:\QPRO tomorrow.
  896.  
  897. That's exactly what having CDPATH=C:\;D:\;E:\... is meant to handle.  I set it
  898. dynamically according to what drives are available at boot (Bernoulli, CD,
  899. ramdisk, etc.) via the following subroutine in my autoexec:
  900.  
  901.  
  902.  rem                           SET CDPATH
  903.  
  904.  :cdpath
  905.  rem The object of the game is to end up with CDPATH set to:
  906.  rem C:\;D:\<etc. to last drive letter>
  907.  set work=CDEFGHIJKLMNOPQRSTUVWXYZ
  908.  set count=1
  909.  set cdpath=C:\
  910.  
  911.  :cdloop
  912.    set d=%@substr[%work,%count,1]:
  913.  rem  if beyond last     OR   beyond end of %work string
  914.    if %d gt %_lastdisk: .or. "%d" == ":" goto cdexit
  915.  rem  skip CD-ROM in MS-DOS or OS/2 DOS
  916.    if %@removable[%d] eq 0 .AND. %@remote[%d] eq 0 set cdpath=%[cdpath];%d\
  917.    set count=%@eval[%count+1]
  918.  goto cdloop
  919.  :cdexit
  920.  
  921.  unset work count d
  922.  return
  923.  
  924. Once this is set, the alias IN will work or you can just PUSHD QPRO and that's
  925. where you'll go.
  926.  
  927. The safest way to move directory trees:
  928.  
  929.     1. Backups
  930.     2. Backups
  931.     3. More Backups
  932.  
  933. If you follow that rule, any of COPY, MOVE, or XCOPY with appropriate command
  934. line switches works fine.
  935.  
  936. Ray
  937.  
  938. There are 2 Replies.
  939.  
  940. #: 290000 S10/JP Software
  941. !   11-Aug-94  13:04:01
  942. Sb: #289811-#My favorite aliases
  943. Fm: Anthony Williams 76655,1552
  944. To: Ray Tackett 76416,276 (X)
  945.  
  946. Ray,
  947.  
  948. I learned something from your system for setting cdpath and using your alias
  949. IN, but I'm afraid it won't work for me.  Unless I'm mistaken, you must have
  950. your executables only in directories just below the root.  This would result
  951. in more first-level directories than I like.  I prefer to have first level
  952. dirs for categories, eg. D:\COSMOS, which contains all my astronomy programs
  953. in separate dirs, eg. SKY\, SUN\, PLAN\, ECL\, etc.
  954.  
  955. Perhaps you have a way of dealing with that, specifically when a program might
  956. be in d:\cosmos\sky or e:\cosmos\sky depending....
  957.  
  958. I guess I've been spoiled by LCD which allows partial names (cd cos).  I'd
  959. like that in running programs.
  960.  
  961. Tony
  962.  
  963. There is 1 Reply.
  964.  
  965. #: 290028 S10/JP Software
  966. !   11-Aug-94  18:55:09
  967. Sb: #290000-#My favorite aliases
  968. Fm: Ray Tackett 76416,276
  969. To: Anthony Williams 76655,1552 (X)
  970.  
  971. Tony,
  972.  
  973. Just a quick, off-the-top shot at it:
  974.  
  975.   in cosmos set cdpath=%[cdpath];%_cwds
  976.  
  977. You could do it a bunch of times like this (packaged up as a subroutine):
  978.  
  979.  :subrout
  980.  set dirstr=COSMOS TOPPERS GEORGES MARIANS KIRBYS NEILS GHOSTS
  981.  set count=0
  982.  
  983.  :loop
  984.  rem Get the next directory name to find
  985.  set work=%@word[%count,%dirstr]
  986.  
  987.  rem Test for end of list
  988.  if "%work" eq "" goto loopexit
  989.  
  990.  rem Do the deed
  991.  in %work set cdpath=%[cdpath];%_cwds
  992.  
  993.  rem Keep on doing it to end of list
  994.  set count=%@eval[%count + 1]
  995.  goto loop
  996.  
  997.  :loopexit
  998.  unset count dirstr
  999.  return
  1000.  
  1001. Again, the above has simply been typed into this message UNTESTED.  I do
  1002. something similar in my autoexec.bat to select TSRs for loading.
  1003.  
  1004. Ray
  1005.  
  1006. P.S. Ten extra points to the first person who can tell me to what those
  1007.      fake directory names refer <g>.
  1008.  
  1009. There are 2 Replies.
  1010.  
  1011. #: 290078 S10/JP Software
  1012. !   12-Aug-94  14:57:18
  1013. Sb: #289811-#My favorite aliases
  1014. Fm: Anthony Williams 76655,1552
  1015. To: Ray Tackett 76416,276 (X)
  1016.  
  1017. Ray,
  1018.  
  1019. I am trying to modify your system for setting CDPATH for my needs and I have
  1020. come on another stumbling block.  In your loop expression I added tests for
  1021. @removable[] and @cdrom[] to set variables for my Bernoulli and CDRom drives.
  1022. So far, so good.  Then I wanted to identify my Ramdisk, if installed.  Since
  1023. there seems no function to identify one, I used a @label[] expression in the
  1024. loop.  This is OK, provided there are disks in the Bernoulli and CDRom.
  1025. Otherwise I get the damned "Drive Not Ready" warning.
  1026.  
  1027. How can I identify a Ramdisk even when the CDRom drive is empty?
  1028.  
  1029. Tony
  1030.  
  1031. There is 1 Reply.
  1032.  
  1033. #: 290107 S10/JP Software
  1034. !   13-Aug-94  00:11:07
  1035. Sb: #290078-#My favorite aliases
  1036. Fm: Ray Tackett 76416,276
  1037. To: Anthony Williams 76655,1552 (X)
  1038.  
  1039. Tony,
  1040.  
  1041. The way I identify mine is to work backward through the alphabet from
  1042. %_lastdisk until I hit the first ready, non-removable, non-remote drive
  1043. letter.  I think you can figure that one out from one of my previous.
  1044.  
  1045. Ray
  1046.  
  1047. There are 2 Replies.
  1048.  
  1049. #: 290151 S10/JP Software
  1050. !   14-Aug-94  05:10:45
  1051. Sb: #290107-#My favorite aliases
  1052. Fm: Anthony Williams 76655,1552
  1053. To: Ray Tackett 76416,276 (X)
  1054.  
  1055. Ray,
  1056.  
  1057. I did succeed in getting what I wanted, but using your original scheme of
  1058. going forward through the drive letters.  I just wrote a series of IFF tests
  1059. for %@cdrom, %@removable, %@ready, and @label.  Works like a charm!  Thanks
  1060. very much for the hints.  Between you and Mike here and the folks at Semware,
  1061. who help me with TSE macros, I am not lacking for stimulation and challenge.
  1062.  
  1063. Tony
  1064.  
  1065. There is 1 Reply.
  1066.  
  1067. #: 289743 S10/JP Software
  1068. !   09-Aug-94  03:21:35
  1069. Sb: #288513-#My favorite aliases
  1070. Fm: Anthony Williams 76655,1552
  1071. To: Sean Fosmire 76207,1120
  1072.  
  1073. Sean,
  1074.  
  1075. Here are some of my favorites.  I do not claim authorship.  Most came from
  1076. this wonderful forum.
  1077.  
  1078.  4ED*DIT=select %1 describe (*.*)
  1079.  @@Shift-F1=so *alias
  1080.  ADDR*ESS=ks "f%&" 13 %+ list e:\mydoc\addr.bk
  1081.  ALLF*REE=free c: %+ free d: %+ free e: %+ free f: %+ free g:
  1082.  ALUP*DATE=pushd c:\4dos50 %+ COPY ALIAS.LST ALIAS.%@SUBSTR[%_TIME,4,1
  1083.       ]%@SUBSTR[%_TIME,6,2] /Q %+ alias > alias.lst %+ echo  !ALIAS
  1084.       LIST UPDATED! %+ renew %+ popd %+ beep
  1085.  DIRARC=dir *.zip;*.arj;*.lzh
  1086.  DIRBAT=dir *.btm;*.bat
  1087.  DIRCMD=dir /k *.exe;*.com;*.btm;*.bat
  1088.  DIREX=dir *.com;*.exe
  1089.  MEMF=free %+ memory
  1090.  NOW=echo It is now %_time on %_dow %_date
  1091.  RENEW=unalias * %+ alias /r c:\4dos50\alias.lst %+ echo ALIAS LIST REREAD!
  1092.  RESETN=unset * %+ set /r c:\4dos50\var.lst %+ echo ENVIRONMENTAL VARIABLES
  1093.       RESET!
  1094.  SOT*se=%& > %tmp%!tsetmp!.!!! %+ e %tmp%!tsetmp!.!!! %+ del %tmp%!tsetmp!.!!!
  1095.  TOCP=prompt $p$g %+ set comspec=c:\dos\command.com %+ c:\dos\command/e:2048
  1096.       %+ c:\4dos50\4start %+ set comspec=c:\4dos50\4dos.com
  1097.  
  1098. Explanation
  1099.  
  1100.  4ED -- select files for writing Descriptions
  1101.  ADDR -- calls up my address book in Buerg's LIST and finds the name I have
  1102.          requested, e.g. "ADDR Smith"
  1103.  ALUP -- updates my master alias list, but only after making a backup
  1104.  DIRARC, DIRBAT, DIRCMD, DIREX -- various selective Dir commands
  1105.  SOT -- puts standard output into my editor via a temp file
  1106.  TOCP -- when I want to see how hard a time the other 99% of PC users have
  1107.          it!
  1108.  
  1109. Tony
  1110.  
  1111. There is 1 Reply.
  1112.  
  1113. #: 289778 S10/JP Software
  1114. !   09-Aug-94  12:48:49
  1115. Sb: #289743-My favorite aliases
  1116. Fm: Allen Cobb 74273,1307
  1117. To: Anthony Williams 76655,1552 (X)
  1118.  
  1119. Keeping the thread alive, here are some of the aliases I use most often:
  1120.  
  1121.  ; Make a directory and move files with same first name into it.
  1122.  MDF=md %1^move %1.* %1^cd %1
  1123.  
  1124.  ; Remove file from B: and copy new version to B:.
  1125.  BDELCOPY=del b:%1^copy %1 b:
  1126.  
  1127.  ; Quick access to doc, bat, & btm files.
  1128.  DOC=c:\util\list.com c:\doc\%1.doc
  1129.  BAT=c:\util\q.exe c:\bat\%1.bat
  1130.  BTM=c:\util\q.exe c:\bat\%1.btm
  1131.  
  1132.  ; Quick setup for 4DOS aliases, etc.  (This may be my favorite.)
  1133.  S4=c:\util\q.exe c:\bat\set4dos.bat c:\4dos\4dos.ini^c:\bat\set4dos.bat
  1134.  
  1135.  ; Directory shortcuts.
  1136.  CD=*pushd
  1137.  PD=pushd
  1138.  BD=popd
  1139.  H=cd \^cdd c:\^cls
  1140.  
  1141.  ; Safety enhancements.
  1142.  MOVE=*move /r
  1143.  COPY=*copy /r
  1144.  DELDIR=echo CAUTION! Removing %1 and all subdirs!^pause^del %1 /sxqy
  1145.  
  1146.  ; Standard calculator alias from docs.
  1147.  CALC=*set x=%@eval[%&]^echo %x
  1148.  
  1149.  ; PKZIP shorthand.
  1150.  UZP=select c:\util\pkunzip (*.*) d:\ %1
  1151.  LZP=select c:\util\pkunzip (*.zip) -vn | list /s
  1152.  AZP=select c:\util\pkzip %1 -a %2& [*.*]
  1153.  
  1154.  ; 50,000,000 directory commands.
  1155.  D=*dir /kmpaou            primary DIR command
  1156.  DB=*dir b: /kpaou         show drive B:
  1157.  DA=*dir /4kmpvou /aa      show everything
  1158.  D2=*dir /p2ou /v          two columns
  1159.  DD=*dir /4kmpv            wide, with sizes
  1160.  DW=*dir /pouwkmv          very wide
  1161.  DF=*dir /pkmt/a-d/o:u     just a file list
  1162.  DC=*dir /kmpaou *.c       c source files
  1163.  DR=*dir /adwkm            just directories, very wide
  1164.  DZ=*dir /su               just space info
  1165.  DZIP=*dir /kmpaou *.zip   just zips
  1166.  DX=except (%%&) *dir /oufp
  1167.  DDIR=*dir /ad             just dirs, listed
  1168.  DRI=dir                   yes, I do this too
  1169.  DIR=*dir /ou              default dir
  1170.  DH=echo D DA DB DD DW DF DC DZ DX DR DDIR DRI DIR
  1171.  
  1172.  Most are pretty obvious, but they're handy anyway!  <g>
  1173.  
  1174.  
  1175.  Malibu, 09-Aug-1994 @ 09:45:56 (NavCIS)
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.